<template>
    <div style="background: #f9fafd;padding-top: 59px;">
        <div class="top-panel">
            <div class="w centerauto">
                <el-row>
                    <el-col :span="17">
                        <el-breadcrumb separator-class="el-icon-arrow-right" class="zb-page-breadcrumb">
                            <el-breadcrumb-item :to="{ path: '/senditem' }">工作台</el-breadcrumb-item>
                            <el-breadcrumb-item>项目</el-breadcrumb-item>
                        </el-breadcrumb>
                        <p class="project-title">{{infoData.p_name}}</p>
                        <div class="project-tip">
                            <span>{{infoData.st_name}}</span>
                            <span class="split">|</span>
                            <span>发布于 {{infoData.p_adopt_time}}</span>
                        </div>
                        <div class="menus_box">
                            <ul class="clearfix">
                                <li class="tab_nav">
                                    <router-link :to="{ path: '/workbench/case', query: { pid: $route.query.pid,'pbid': $route.query.pbid}}" class="link">
                                        <span>竞标方案</span>
                                    </router-link>
                                </li>
                                <li class="tab_nav">
                                    <router-link :to="{ path: '/workbench/detailsr', query: { 'pid': $route.query.pid,'pbid': $route.query.pbid}}" class="link">
                                        <span>详情</span>
                                    </router-link>
                                </li>
                            </ul>
                        </div>
                    </el-col>
                    <el-col :span="7">
                        <div class="text-right">
                            <p class="itemstatus">{{infoData.p_status | re_p_status}}</p>
                            <span class="itemmoney">￥{{infoData.p_budget | re_p_budget}}</span>
                            <span class="itemcycle">希望在 {{infoData.p_cycle}} {{infoData.p_cycle_type | rep_cycle_type}}内完成</span>
                        </div>
                    </el-col>
                </el-row>
            </div>
        </div>
        <!-- 内容 -->
        <div>
            <div class="mtb-large">
                <div class="w centerauto">
                    <router-view></router-view>
                </div>
            </div>
        </div>
        
    </div>
</template>
<script>

    import '../../../assets/css/workbench.css'
    import '../../../assets/css/capitalaccount.css'
    import '../../../assets/css/projects.css'
    import '../../../assets/css/ucenter.css'
    export default {
        data(){
            return{
                infoData: {},
            }
        },
        filters: {
            //项目金额
            re_p_budget: function (value) {
                var val = 0;
                if (value == 1){
                    val = '3000以下';
                }else if (value == 2){
                    val = '3000-5000';
                }else if (value == 3){
                    val = '5000-10000';
                }else if (value == 4){
                    val = '10000-50000 ';
                }else if (value == 5){
                    val = '50000-100000';
                }else if (value == 6){
                    val = '100000 以上';
                }
                return val;
            },
            //项目周期单位
            rep_cycle_type: function(value){

                var val = '';
                if(value == 1){
                    val = '天';
                }else if(value == 2){
                    val = '周';
                }else if(value == 3){
                    val = '月';
                }
                return val;
            },
            //截取日期字符串
            adopt_time: function(value){
                if(value){
                    return value.substr(0,10)
                }else{
                    return ''
                }
            },
            //项目状态
            re_p_status: function (value) {
                var val = '';
                if (value == 1){
                    val = '待发布';
                }else if (value == 2){
                    val = '审核中';
                }else if (value == 3){
                    val = '竞标中';
                }else if (value == 4){
                    val = '审核失败 ';
                }else if (value == 5){
                    val = '已完成';
                }
                return val;
            },
        },
        methods: {
            init(){
                
                var _this = this;
                this.$httpGet('/api/index/Project/projectDetail',{'p_id': this.$route.query.pid,'p_uid': window.localStorage.uid}).then(response => {

                    if(response.code == 200){

                        _this.infoData = response.msg;
                        
                    }else{
                        this.$message({
                            message: response.msg,
                            type: 'warning'
                        });
                    }

                });
            },
        },
        mounted(){
            this.init();
        },
        watch: {
            
        },
    }
</script>
<style scoped>
    
</style>